package com.orange.proxyPattens.dynamicProxy.interceptor;

import net.sf.cglib.proxy.CallbackFilter;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class LogInterceptor implements MethodInterceptor {

    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("进行日志记录");
        // 调用被代理对象的方法
        return methodProxy.invokeSuper(o, objects);
    }
}
